{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33.28"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = [19, 12.28]\n",
    "b = sum(a,2)\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "704.45"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = [24.5, 15.6, 56.9, 75, 49, 12.51, 200, 19, 35.4, 13.76, 12.28, 45.5, 145]\n",
    "b = round(sum(a),2) \n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4260,)"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "240+120+60+1920+1920, "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "96.0"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "117+ 135\n",
    "480/5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "447"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# made in china 10%\n",
    "(2465-2140)/2140 \n",
    "2465-2140\n",
    "\n",
    "# do not made in china\n",
    "a = 2181.42/2465\n",
    "\n",
    "2324.78/a # 2677\n",
    "2627-2180\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "341.03"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4480/64\n",
    "4860/100\n",
    "291.03+50"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(164.69, 4)"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 3季度报销\n",
    "a = [87.02, 18.01, 19.21, 31.15, 30, 9.6, 27, 29.02, 20.04, 43.65, 56.51, 5, 38.11, 36.38, 39]\n",
    "round(sum(a), 2)\n",
    "\n",
    "489.7-(143+147+102+97.7)\n",
    "143+147+102+97.7\n",
    "\n",
    "a = [60.48, 38.88, 28.80, 18]\n",
    "round(sum(a), 2)\n",
    "\n",
    "\n",
    "a = [39.22, 143, 10.6, 590, 28.5, 57, 131.6]\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "\n",
    "a = [77.6, 18, 294.2, 176, 180, 98.08, 15.58, 102]\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "a = [40.4, 10, 12.1, 4.8, 40.07, 147, 97.7, 6, 18.08, 21.93, 14.79, 4.27, 5.43, 56, 146.16, 138.02, 36, 9.53, 65, 22.01] # 138.02米思米\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "\n",
    "   \n",
    "# a = [1210, 150, 700, 200]\n",
    "# round(sum(a), 2), len(a)\n",
    "\n",
    "a = [9.08, 30.11, 105.21, 20.29] \n",
    "round(sum(a), 2), len(a)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "12.7"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "6+2+2.5+2+7+2\n",
    "# 195/2\n",
    "25.4/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "305.0"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.5*(0.5*23+0.5*77)\n",
    "\n",
    "23/77\n",
    "45/77\n",
    "35*8\n",
    "# 35*7\n",
    "# 0.5*(0.5*45+0.5*77)\n",
    "# 12701+13484+5720+10895+12050\n",
    "# 0.71*25.4\n",
    "21.5/2\n",
    "300/360\n",
    "42.5-90\n",
    "\n",
    "4984/44\n",
    "114*44\n",
    "\n",
    "4818/44\n",
    "\n",
    "4880/16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4.700961894323342 5.783493649053891 2.8917468245269453\n"
     ]
    }
   ],
   "source": [
    "#螺纹计算\n",
    "import numpy as np\n",
    "\n",
    "# p是螺距\n",
    "# d是名义直径\n",
    "p = 1.5\n",
    "d = 20\n",
    "\n",
    "p = 2\n",
    "d = 30\n",
    "\n",
    "\n",
    "\n",
    "p = 1\n",
    "d = 10\n",
    "\n",
    "p = 0.35\n",
    "d = 1.6\n",
    "\n",
    "p = 1\n",
    "d = 18\n",
    "\n",
    "p = 1\n",
    "d = 20\n",
    "\n",
    "p = 1\n",
    "d = 6\n",
    "\n",
    "# p = 0.8\n",
    "# d = 5\n",
    "\n",
    "# p = 0.5\n",
    "# d = 20\n",
    "\n",
    "\n",
    "# p = 1\n",
    "# d = 24\n",
    "\n",
    "# p = 1\n",
    "# d = 22\n",
    "\n",
    "# p = 1\n",
    "# d = 25\n",
    "\n",
    "\n",
    "h =np.sqrt(3)/2*p\n",
    "h\n",
    "\n",
    "# d1是螺纹小径\n",
    "# 内外螺纹小径相同\n",
    "d1 = d-2*6/8*h\n",
    "d1,d1/2\n",
    "\n",
    "# d2是螺纹大径\n",
    "# 内外螺纹大径相同\n",
    "d2 = d-2*1/8*h\n",
    "d2\n",
    "\n",
    "\n",
    "print(d1,d2, d2/2)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(44553, 4)"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 2022年欠账\n",
    "\n",
    "a = [10895, 5720, 15237, 12701] \n",
    "round(sum(a), 2), len(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\arg{\\left(a e^{\\frac{i \\pi}{6}} \\right)}$"
      ],
      "text/plain": [
       "arg(a*exp(I*pi/6))"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import re, im, I, E, symbols, pi, arg\n",
    "import sympy\n",
    "a, b, z = symbols('a b z', real=True)\n",
    "z = a*E**(I*(pi/6))\n",
    "\n",
    "im(z)\n",
    "arg(z)\n",
    "# sympy.solve(arg(z))\n",
    "# arg(z).eval()\n",
    "\n",
    "# z\n",
    "# z = a+b*I\n",
    "# arg(z).eval()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(43651.68, 4)"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 23年待付款\n",
    "b = 2835*4\n",
    "\n",
    "a = [3483, 13721.68, 15107, b] \n",
    "round(sum(a), 2), len(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(18.0, 0.72, 12.0)"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 棘轮\n",
    "24*2.5\n",
    "m = 0.6\n",
    "z = 30\n",
    "\n",
    "# m = 0.8\n",
    "# z = 60\n",
    "\n",
    "da = m*z\n",
    "a = 1.2*m\n",
    "\n",
    "\n",
    "angle = 360*m/da\n",
    "\n",
    "da, a, angle\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8640000"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1620/54\n",
    "14*4.38\n",
    "510/2\n",
    "6.5+2+2+8.5+2\n",
    "\n",
    "3600*8*300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 扭簧计算\n",
    "import numpy as np\n",
    "\n",
    "mm_to_meter = 1/1000\n",
    "d2 = 0.1\n",
    "e = 0.1\n",
    "n = 3\n",
    "\n",
    "\n",
    "i = np.pi*d2**4/64 #钢丝的惯性距\n",
    "kr = e*i/(180*n*d1) #扭转弹簧强度\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(18700, 5)"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#主被动2代成本减少\n",
    "\n",
    "#脚轮\n",
    "a = [5.01, 49.78, 51.33, 48.31, 27.43, 56.64, 76.99] \n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "#上肢\n",
    "a = [537.96, 132.74, 173.45] #数量2\n",
    "\n",
    "b = [216.81, 154.87, 57.52, 70.80, 65.49, 214.16, 100.84, 20.80] #数量1\n",
    "\n",
    "2*round(sum(a), 2)+round(sum(b), 2)\n",
    "\n",
    "203.54*2 # 新上肢连杆与脚连杆成本相当\n",
    "\n",
    "\n",
    "# 电机\n",
    "2324.77*2\n",
    "\n",
    "a = [4000, 3500, 6000, 3900, 1300] \n",
    "round(sum(a), 2), len(a)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1228.14, 10)"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 11月报销\n",
    "\n",
    "a = [10, 26.76] \n",
    "# round(sum(a), 2), len(a)\n",
    "f'{sum(a):.2f}'\n",
    "\n",
    "\n",
    "\n",
    "a = [53.44, 20.53, 55.51, 1.58, 22.92, ] \n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "a = [72.23, 36.12, 36.85,] \n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "a = [41.76, 153.98, 50, 189, 100, 40.4, 9.8, 15, 483, 145.2] \n",
    "round(sum(a), 2), len(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(571.8, 13)"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 12月报销\n",
    "a = [8.13, 13.50, 9.54, 42, 13.4, 36.6, 24.9, 45, 10.52, 52.4, 114.6, 104.8, 96.41] \n",
    "round(sum(a), 2), len(a)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.274"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "扭矩g_cm转n_m\n",
    "'''\n",
    "\n",
    "gc_to_nm = 9.8e-5\n",
    "\n",
    "kgc_to_nm = 9.8e-2\n",
    "\n",
    "15*gc_to_nm\n",
    "2000*gc_to_nm\n",
    "# 1*gc_to_nm\n",
    "\n",
    "13*kgc_to_nm\n",
    "\n",
    "\n",
    "330*gc_to_nm\n",
    "\n",
    "1000*gc_to_nm\n",
    "\n",
    "0.4*kgc_to_nm\n",
    "\n",
    "1.5*kgc_to_nm\n",
    "\n",
    "0.35*kgc_to_nm\n",
    "\n",
    "# #14.9级M6螺钉承载力计算\n",
    "# d1 = 4.917*1e-3\n",
    "\n",
    "# area = \n",
    "\n",
    "# 1400*\n",
    "\n",
    "40.5+17.5\n",
    "41+21.5\n",
    "11+27+9\n",
    "\n",
    "# 1.2*kgc_to_nm\n",
    "\n",
    "# 33+16\n",
    "\n",
    "2.8*kgc_to_nm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "#14.9级M6螺钉承载力计算\n",
    "# grade = 1400*1e6\n",
    "grade = 800*1e6 #Mpa转为pa\n",
    "\n",
    "\n",
    "d1 = 4.917*1e-3 #mm转为m\n",
    "\n",
    "d1\n",
    "\n",
    "area = np.pi*(d1/2)**2\n",
    "area\n",
    "# (d1/2)**2\n",
    "\n",
    "\n",
    "f = grade*area\n",
    "f\n",
    "# load = f/9.8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(976.09, 8)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 订单号: 3788318017293844209  开始\n",
    "# 订单号: 3843454465018844209  结束\n",
    "\n",
    "\n",
    "# a = [12.18, 10.16, 26.37, 92, 1.6, 1.88, 45, 5.01, 20.3, 18.3, 15.84, 23.4, 39,\\\n",
    "#      23.4, 77, 576]\n",
    "# round(sum(a), 2), len(a)\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "a = [ 14.16, 68.55, 53.35,  125.82,  630, 44.9, 10, 29.31]\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "\n",
    "# a = [57.48, 229, 630]\n",
    "# round(sum(a), 2), len(a)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(201.91, 7)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "订单号: 3855797965165844209  开始\n",
    "订单号: 3877277148024844209  结束\n",
    "'''\n",
    "\n",
    "\n",
    "a = [ 453.8, 229.2, 8.38,  8,  21.56, 49.9, 6.99]\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "\n",
    "a = [1.33, 4.6, 11.9, 45, 10, 57.48, 71.6]\n",
    "round(sum(a), 2), len(a)\n",
    "\n",
    "# 4890 - 4380\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.244999999999999"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "24*10**6/(9*3600)\n",
    "1600*0.87\n",
    "15*0.283"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19439"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "舍佛瑞对账\n",
    "'''\n",
    "\n",
    "a = [4755, 4950, 4894, 4840, 2765]\n",
    "a1 = round(sum(a), 2), len(a)\n",
    "\n",
    "a1[0] - (16839 + 2765)\n",
    "\n",
    "a1[0]-2765\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(41823.5, 18)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "cc票\n",
    "'''\n",
    "a = [2109, 1000, 26800, 328, 317, 194, 299, 398, 386, 538, 922, 190, 6378, 369.5, 149, 186, 260, 1000]\n",
    "round(sum(a), 2), len(a)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.1"
  },
  "vscode": {
   "interpreter": {
    "hash": "ad2bdc8ecc057115af97d19610ffacc2b4e99fae6737bb82f5d7fb13d2f2c186"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
